import request from 'utils/request';

export const getChannelsList = () => {
  return request({
    url: '/v1_0/channels'
  });
};

export const getArticleList = params => {
  return request({
    url: '/v1_0/mp/articles',
    params
  });
};

// 删除用户数据
export const DeleteById = id => {
  return request({
    url: '/v1_0/mp/articles/' + id,
    method: 'DELETE'
  });
};
//根据id获取文章详情
export const getArticleByIdAPI = id => {
  return request({
    url: '/v1_0/mp/articles/' + id
  });
};
// 编辑文章
export const editArticleByIdAPI = (data, draft = false) => {
  return request({
    url: `/v1_0/mp/articles/${data.id}?draft=${draft}`,
    method: 'PUT',
    data
  });
};
